package com.xca.znb.presenter;

import com.xca.znb.contact.ProcurementMessageContact;
import com.xca.znb.entity.Procurement;
import com.xca.znb.model.imodel.IProcurementMessage;

public class ProcurementMessagePresenter {
    private ProcurementMessageContact contact ;
    private IProcurementMessage iProcurementMessage ;
    public ProcurementMessagePresenter(ProcurementMessageContact contact , IProcurementMessage iProcurementMessage){
        this.contact = contact ;
        this.iProcurementMessage = iProcurementMessage ;
    }

    public void showMessageById(int id){
        Procurement procurement = iProcurementMessage.getProcurementById(id);
        String type = procurement.getType();
        String variety = procurement.getVariety();
        String num = procurement.getNeed();
        String unit  = procurement.getUnit();
        String local = procurement.getOrigin();
        String time = procurement.getCycle();
        String getLocal = procurement.getDelivery();
        String text = procurement.getText();
        contact.getProcurementById(type,variety,num,unit,local,time,getLocal,text);
    }
    public void deleteProcurementById(int id){
        iProcurementMessage.deleteProcurementById(id);
    }
    public Procurement getProcurementById(int id){
        return iProcurementMessage.getProcurementById(id);
    }
}
